package day7.problem1;

//字符串中找出连续最长的数字串
//https://www.nowcoder.com/practice/bd891093881d4ddf9e56e7cc8416562d?tpId=182&tqId=34785&ru=/exam/oj

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        int len = 0, index = 0, n = str.length();
        int i = 0;
        while(i < n) {
            int j = i;
            while(j < n && Character.isDigit(str.charAt(j))) {
                j++;
            }
            if(j - i > len) {
                len = j - i;
                index = i;
            }
            i = j + 1;
        }
        String ret = str.substring(index,index + len);
        System.out.println(ret);
    }
}